package cn.royan.fl 
{
	import cn.royan.fl.interfaces.IRequest;
	import flash.events.EventDispatcher;
	
	/**
	 * ...
	 * @author RoYan
	 */
	public class ClientSocket extends EventDispatcher 
	{
		protected var socketFacade:SocketFacade;
		protected var host:String;
		protected var port:int;
		
		public function ClientSocket( host:String, port:int ) 
		{
			this.host = host;
			this.port = port;
			
			socketFacade = SocketFacade.getInstance();
		}
		
		public function start():void
		{
			socketFacade.startUp( host, port, this );
		}
		
		public function sendRequest( irequest:IRequest ):void
		{
			socketFacade.sendNotification( SocketFacade.PACKET_DISPATCH, irequest );
		}
	}

}